def GetValue(node) :
    if node.childNodes[0].nodeType==node.CDATA_SECTION_NODE :
        return node.childNodes[0].nodeValue
    elif node.childNodes[0].nodeType==node.TEXT_NODE :
        return node.childNodes[0].nodeValue
    else :
        return ""
    
class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y
        
    def __cmp__(self, other):
        if self.x > other.x or (self.x == other.x and self.y > other.y) :
            return 1
        elif self.x == other.x and self.y == other.y :
            return 0
        else :
            return -1
        
    def __hash__(self):
        return 104723*self.y + self.x

class ApiError(Exception):
    """Exception raised for errors in the API.

    Attributes:
        msg  -- explanation of the error
    """

    def __init__(self, msg):
        Exception.__init__(self)
        self.msg = msg
